/*
 * Copyright (c) 2016 zhangcm. All Rights Reserved.
 */
package com.jnzc.ocr.common.utils;

import com.google.gson.Gson;

import java.lang.reflect.Type;

/**
 * @author zhangcm
 * @version 1.0, 2017/9/11
 */
public class JsonUtils {

    private static Gson gson;
    static {
        gson = new Gson();
    }

    public static String toJson(Object o){
        return gson.toJson(o);
    }

    public static <T> T fromJson(String json, Type type){
        return gson.fromJson(json, type);
    }
}
